// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   BaseException.java

package cn.com.pusai.common.exception;

import cn.com.pusai.core.exception.ServiceException;
import java.io.PrintStream;

public class BaseException extends ServiceException
{

	private static final long serialVersionUID = 1L;
	private String errorCode;
	private String errorDescription;

	public BaseException()
	{
		errorCode = null;
	}

	public BaseException(String message, boolean hasCode)
	{
		super(message);
		errorCode = null;
		errorDescription = message;
	}

	public BaseException(Throwable cause)
	{
		super(cause);
		errorCode = null;
	}

	public BaseException(String message, Throwable cause)
	{
		super(message, cause);
		errorCode = null;
		errorDescription = message;
	}

	public BaseException(BaseException cause)
	{
		super(cause);
		errorCode = null;
		errorCode = cause.getErrorCode();
		errorDescription = cause.getErrorDescription();
	}

	public BaseException(ServiceException cause)
	{
		super(cause);
		errorCode = null;
		errorDescription = cause.getErrorDescription();
	}

	public BaseException(String errorCode)
	{
		this.errorCode = null;
		this.errorCode = errorCode;
	}

	public BaseException(String errorCode, String msg)
	{
		super(msg);
		this.errorCode = null;
		this.errorCode = errorCode;
		errorDescription = msg;
	}

	public String getErrorCode()
	{
		return errorCode;
	}

	public String getErrorDescription()
	{
		return errorDescription;
	}

	public String getMessage()
	{
		return errorDescription;
	}

	public void printStackTrace()
	{
		if (errorDescription == null)
			System.err.println((new StringBuilder("Exception: ")).append(errorCode).toString());
		else
			System.err.println((new StringBuilder("Exception: ")).append(errorDescription).toString());
		super.printStackTrace();
	}

	
}
